package svc

import (
	"go-pod/pod-rpc/internal/config"
	"go-pod/pod-rpc/model"

	"github.com/zeromicro/go-zero/core/stores/sqlx"
)

type ServiceContext struct {
	Config       config.Config
	PodcastModel model.PodcastsModel
}

func NewServiceContext(c config.Config) *ServiceContext {
	conn := sqlx.NewMysql(c.MySQL.DataSource)
	return &ServiceContext{
		Config:       c,
		PodcastModel: model.NewPodcastsModel(conn),
	}
}
